package xuegao.study.mall.admin.feign;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.model.oauth.OauthClientDetails;

import java.util.List;

@FeignClient(contextId = "auth", name = "study-oauth2-service", path = "/auth/app")
public interface AuthAppClient {

    @ApiOperation("创建app")
    @PostMapping(value = "/create")
    CommonResult create(@RequestBody OauthClientDetails details);

    @ApiOperation("更新app")
    @PostMapping(value = "/update")
    CommonResult update(@RequestBody OauthClientDetails details);

    @ApiOperation("获取app列表")
    @GetMapping(value = "/list")
    CommonResult<List<OauthClientDetails>> list();

    @ApiOperation("删除app")
    @PostMapping(value = "/delete/{clientId}")
    CommonResult delete(@PathVariable String clientId);
}
